<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <script src="../js/jquery-3.4.1.min.js"></script>
        <script>
            $(function(){
                $("input").click(function(){

                    //一般建议自定义属性以data开头
                    console.log($("input").attr("data-id"));
                    console.log($("input").attr("data-name"));
                    console.log($("input").attr("hello"));
                });
            });
        </script>
    </head>
    <body>
        <input type="button" value="自定义属性" data-id="10" data-name="alice" hello="world">
    </body>
</html>